﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Dto = Bowerbird.Api.Dtos;

namespace Bowerbird.Api
{
    public static class Link
    {
 
        public static Dto.Link Create(LinkRel linkRel, UrnResource urnResource, string identifier)
        {
            return new Dto.Link 
            {
                rel = linkRel.LowerString(),
                href = String.Format("http://localhost/bowerbird/{0}/{1}", urnResource.LowerString(), identifier)
            };
        }

    }

    public enum LinkRel
    {
        Self
    }

    public static class LinkExtensions
    {
        public static string LowerString(this LinkRel rel)
        {
            return rel.ToString().ToLower();
        }
    }
}